package com.bilibili.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bilibili.dao.UserRoleMapper;
import com.bilibili.domain.entity.UserRole;
import com.bilibili.service.UserRoleService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author www
* @description 针对表【t_user_role(用户角色关联表)】的数据库操作Service实现
* @createDate 2024-06-10 16:40:07
*/
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole>
    implements UserRoleService {

    @Resource
    private UserRoleMapper userRoleMapper;

    private LambdaQueryWrapper<UserRole> wrapper = new LambdaQueryWrapper<>();

    @Override
    public List<UserRole> getByUserId(Long userId) {
        wrapper.eq(UserRole::getUserId,userId);
        return userRoleMapper.selectList(wrapper);
    }
}




